package com.qk.mapper;

import com.qk.entity.Course;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CourseMapper {
    @Delete("delete from course where id=#{id}")
    void deleteById(Integer id);//删除部门


    List<Course> list(Integer subject, Integer target);//查询课程列表

    @Insert("insert into course(name,subject,price,target,description,create_time,update_time) values(#{name},#{subject},#{price},#{target},#{description},#{createTime},#{updateTime})")
    void add(Course course);//添加课程

    @Select("select id, subject, name, price, target, description, create_time, update_time from course where id=#{id}")
    Course selectById(Integer id);//获取部门信息

    @Update("update course set name=#{name},subject=#{subject},price=#{price},target=#{target},description=#{description},update_time=#{updateTime} where id=#{id}")
    void update(Course course);//修改部门信息

    @Select("select id, subject, name, price, target, description, create_time, update_time from course")
    List<Course> listAll();//查询所有课程

    List<Course> listBySubject(Integer subject);
}
